@import './themes.css';
@import './buttons.css';

.layout-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  position: relative;
  overflow: hidden;
}

/* 背景层 */
.background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

/* 粒子效果 */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: float 6s infinite ease-in-out;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0);
    opacity: 0.6;
  }
  50% {
    transform: translate(20px, 20px);
    opacity: 1;
  }
}

/* 网格线 */
.grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(30px, 30px);
  }
}

/* 悬浮元素 */
.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.element {
  position: absolute;
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  animation: float-element 15s infinite linear;
}

.element-1 {
  width: 80px;
  height: 80px;
  top: 10%;
  left: 5%;
  animation-duration: 20s;
}

.element-2 {
  width: 120px;
  height: 120px;
  bottom: 15%;
  right: 10%;
  animation-duration: 25s;
  animation-direction: reverse;
}

.element-3 {
  width: 60px;
  height: 60px;
  top: 40%;
  right: 20%;
  animation-duration: 18s;
}

.element-4 {
  width: 100px;
  height: 100px;
  bottom: 20%;
  left: 15%;
  animation-duration: 22s;
  animation-direction: reverse;
}

@keyframes float-element {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(20px, 30px) rotate(90deg);
  }
  50% {
    transform: translate(0, 60px) rotate(180deg);
  }
  75% {
    transform: translate(-20px, 30px) rotate(270deg);
  }
  100% {
    transform: translate(0, 0) rotate(360deg);
  }
}

.main-layout {
  position: relative;
  z-index: 1;
  background: transparent !important;
}

.sider {
  box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
  z-index: 10;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.logo {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.logo-wrapper {
  display: flex;
  justify-content: center;
  margin-right: 12px;
}

.logo-image {
  width: 40px;
  height: 40px;
  animation: pulse 3s infinite;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(102, 126, 234, 0.7));
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(102, 126, 234, 0.7));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.9));
  }
}

.logo-text {
  color: white;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

:deep(.ant-menu-dark) {
  background: transparent;
}

:deep(.ant-menu-dark .ant-menu-inline) {
  background: transparent;
}

:deep(.ant-menu-dark .ant-menu-item:hover) {
  background: rgba(102, 126, 234, 0.2);
}

:deep(.ant-menu-dark .ant-menu-item-selected) {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
}

/* 为黑蓝主题定制菜单项选中样式 */
.layout-container.theme-blackblue :deep(.ant-menu-dark .ant-menu-item-selected) {
  background: linear-gradient(90deg, rgba(22, 119, 255, 0.5), rgba(22, 119, 255, 0.1));
}

/* 为黑蓝主题定制菜单项悬停样式 */
.layout-container.theme-blackblue :deep(.ant-menu-dark .ant-menu-item:hover) {
  background: rgba(22, 119, 255, 0.2);
}

.header {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  position: sticky;
  top: 0;
  z-index: 9;
  color: white;
}

:deep(.ant-layout-header) {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0 24px;
  height: 64px;
  line-height: 64px;
  color: white;
}

.header-left {
  display: flex;
  align-items: center;
}

.trigger {
  font-size: 18px;
  line-height: 64px;
  padding: 0 24px;
  cursor: pointer;
  transition: color 0.3s;
  color: rgba(255, 255, 255, 0.85);
}

.trigger:hover {
  color: #667eea;
  text-shadow: 0 0 8px rgba(102, 126, 234, 0.6);
}

.breadcrumb {
  margin-left: 16px;
}

:deep(.ant-breadcrumb) {
  color: white;
}

:deep(.ant-breadcrumb a) {
  color: rgba(255, 255, 255, 0.85);
}

:deep(.ant-breadcrumb span:last-child) {
  color: rgba(255, 255, 255, 0.7);
}

:deep(.ant-breadcrumb .ant-breadcrumb-link) {
  color: white;
}

:deep(.ant-breadcrumb .ant-breadcrumb-separator) {
  color: rgba(255, 255, 255, 0.5);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-icon {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.user-info {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}

.user-name {
  color: rgba(255, 255, 255, 0.85);
}

.content {
  margin: 24px 16px 0;
  overflow: initial;
  position: relative;
  z-index: 1;
  background: transparent !important;
}

:deep(.ant-layout-content) {
  background: transparent !important;
}

.content-wrapper {
  padding: 24px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  min-height: calc(100vh - 168px);
  position: relative;
  overflow: hidden;
  color: white;
}

.content-wrapper::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transform: rotate(45deg);
  animation: shine 6s infinite;
  z-index: -1;
}

@keyframes shine {
  0% {
    transform: rotate(45deg) translateX(-100%);
  }
  100% {
    transform: rotate(45deg) translateX(100%);
  }
}

.welcome-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 30px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  color: white;
}

.welcome-card h1 {
  color: white;
  font-size: 28px;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.welcome-card p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  margin-bottom: 30px;
}

.welcome-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 20px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: bold;
  color: #667eea;
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.stat-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.info-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

:deep(.info-card .ant-card-head) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0 20px;
  background: transparent;
}

:deep(.info-card .ant-card-head-title) {
  color: white;
}

:deep(.info-card .ant-card-body) {
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
}

:deep(.ant-btn-background-ghost.ant-btn-primary) {
  color: #667eea;
  border-color: #667eea;
  background: transparent;
}

:deep(.ant-btn-background-ghost.ant-btn-primary:hover) {
  color: #764ba2;
  border-color: #764ba2;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.6);
}

.footer {
  text-align: center;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin-top: 24px;
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.7);
}

:deep(.ant-layout-footer) {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.7);
}

.footer-content {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* 下拉菜单样式 */
:deep(.notification-menu),
:deep(.user-menu),
:deep(.theme-menu) {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
}

:deep(.notification-menu .ant-menu-item),
:deep(.user-menu .ant-menu-item),
:deep(.theme-menu .ant-menu-item) {
  color: rgba(255, 255, 255, 0.85);
}

:deep(.notification-menu .ant-menu-item:hover),
:deep(.user-menu .ant-menu-item:hover),
:deep(.theme-menu .ant-menu-item:hover) {
  background: rgba(102, 126, 234, 0.2);
  color: white;
}

/* 主题切换按钮样式 */
:deep(.theme-switch-button) {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.3);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  transition: all 0.3s ease;
}

:deep(.theme-switch-button:hover),
:deep(.theme-switch-button:focus) {
  background: rgba(102, 126, 234, 0.3);
  border-color: rgba(102, 126, 234, 0.5);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

:deep(.theme-switch-button:active) {
  background: rgba(102, 126, 234, 0.15);
  box-shadow: 0 1px 4px rgba(102, 126, 234, 0.2);
}

/* 主题预览样式 */
.theme-preview {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  margin-right: 8px;
  display: inline-block;
  vertical-align: middle;
}

.theme-default {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.theme-green {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

.theme-purple {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.theme-darkblue {
  background: linear-gradient(135deg, #0f0c29, #302b63);
}

.theme-blackblue {
  background: linear-gradient(135deg, #0f172a, #1e40af);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .sider {
    position: absolute;
  }
  
  .header {
    padding: 0 12px;
  }
  
  .content {
    margin: 12px 8px 0;
  }
  
  .content-wrapper {
    padding: 16px;
  }
  
  .welcome-stats {
    flex-direction: column;
    gap: 20px;
  }
  
  .info-cards {
    grid-template-columns: 1fr;
  }
  
  .main-layout {
    margin-left: 0;
  }
}